var designWidth = 1080; // 设计稿宽度
var viewportWidth = document.documentElement.clientWidth; // 当前视口宽度
if (viewportWidth > designWidth) {
    viewportWidth = designWidth;
} else if (viewportWidth < 320) {
    viewportWidth = 320;
}
document.documentElement.style.fontSize = viewportWidth / (designWidth / 100) + 'px';
window.onresize = function() {
    fontSizeAuto(designWidth);
};